package com.mykt.utils;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public class StringUtils extends org.apache.commons.lang3.StringUtils {

    public static boolean matches(String str, List<String> strs)
    {
        if (isEmpty(str) || strs == null || strs.size() < 1 )
        {
            return false;
        }

        for (String pattern : strs)
        {
            if (pattern.equals(str))
            {
                return true;
            }
        }
        return false;
    }


    public static boolean isEmpty(Map<?, ?> map)
    {
        return isNull(map) || map.isEmpty();
    }

    public static boolean isNull(Object object)
    {
        return object == null;
    }

    public static boolean isNotNull(Object object)
    {
        return !isNull(object);
    }

    /**
     * 是否包含字符串
     */
    public static boolean inStringIgnoreCase(String str, String... strs)
    {
        if (str != null && strs != null)
        {
            for (String s : strs)
            {
                if (str.equalsIgnoreCase(trim(s)))
                {
                    return true;
                }
            }
        }
        return false;
    }

}
